﻿using System.Data;
using System.Data.SqlClient;

namespace WcfDataSet
{
    public class DummyDbHelper
    {
        private string _connectionString;

        public DummyDbHelper(string connectionString)
        {
            _connectionString = connectionString;
        }

        public DataSet FillDataSet(string sql)
        {
            var result = new DataSet();

            using (var connection = new SqlConnection(_connectionString))
            {
                using (var adapter = new SqlDataAdapter(sql, connection))
                {
                    adapter.Fill(result);
                }
            }

            return result;
        }
    }
}